package polimi.sc.expoquest.storage;

import android.provider.BaseColumns;

/**
 * Represents the contract with the Database schema. This is a container for constants,
 * tables, and columns.This allow us to use the same constants across the other classes in the
 * same package
 * 
 * Organizaton:
 * 1. Definitions that are global to your whole database in the root of the level of the class.
 * 2. Create an inner class for each table that enumerates its columns.
 * 3. The inner class can implement the interface BaseColumns such that it will inheritate the
 * primary key field called _ID, that some android class such as cursor adaptors will expect to have.
 * IT IS NOT REQUIRED, but this can help our database to work harmoniously with the android framework.
 * 
 * @author Monica Lozano
 *
 */
public final class DBContract {
	
	//Avoids instantiation
	private DBContract(){}

	/**
	 * This class represents the constants and the data related to the user
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class User implements BaseColumns{
		
		public static final String TABLE_NAME="user";
		public static final String CLM_NAME_USERNAME ="username";
		public static final String CLM_NAME_PASSWORD="password";
		public static final String CLM_NAME_TOTALSCORE="tscore";
		public static final String[] ALL_COLUMNS = { _ID, CLM_NAME_USERNAME,
				CLM_NAME_PASSWORD, CLM_NAME_TOTALSCORE };
		
	}
	
	/**
	 * This class represents the constants and the data related to the single_game
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class SingleGame implements BaseColumns{
		
		public static final String TABLE_NAME="single_game";
		public static final String CLM_NAME_DESCRIPTION ="description";
		public static final String CLM_NAME_PIC_URI="pic_uri";
		public static final String CLM_NAME_MAXPOINTS="max_points";
		public static final String CLM_NAME_TYPE="game_type";
		public static final String[] ALL_COLUMNS = { _ID, CLM_NAME_DESCRIPTION,
				CLM_NAME_PIC_URI, CLM_NAME_MAXPOINTS, CLM_NAME_TYPE };
		
	}
	
	/**
	 * This class represents the constants and the data related to the playgame
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class PlayGame implements BaseColumns{
		
		public static final String TABLE_NAME="playgame";
		public static final String CLM_NAME_COMMENT ="tcomment";
		public static final String CLM_NAME_PIC_URI="pic_uri";
		public static final String CLM_NAME_OPTION_ID="option_id";
		public static final String CLM_NAME_POINTS="points";
		public static final String CLM_NAME_USER_ID="user_id";
		public static final String CLM_NAME_GAME_ID = "game_id";
		public static final String[] ALL_COLUMNS = { _ID, CLM_NAME_COMMENT,
				CLM_NAME_PIC_URI, CLM_NAME_OPTION_ID,
				CLM_NAME_POINTS, CLM_NAME_USER_ID,CLM_NAME_GAME_ID };
		
	}
	
	/**
	 * This class represents the constants and the data related to the gossip
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class Gossip implements BaseColumns{
		
		public static final String TABLE_NAME="gossip";
		public static final String CLM_NAME_GOSSIP ="tgossip";
		public static final String CLM_NAME_PIC_URI="pic_uri";
		public static final String CLM_NAME_USER_ID="user_id";
		public static final String[] ALL_COLUMNS = { _ID, CLM_NAME_GOSSIP,
				CLM_NAME_PIC_URI, CLM_NAME_USER_ID };
		
	}
	
	/**
	 * This class represents the constants and the data related to the gossip_comment
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class GossipComment implements BaseColumns{
		
		public static final String TABLE_NAME="gossip_comment";
		public static final String CLM_NAME_COMMENT ="comment";
		public static final String CLM_NAME_GOSSIP_ID="gossip_id";
		public static final String CLM_NAME_USER_ID="user_id";
		public static final String[] ALL_COLUMNS = { _ID, CLM_NAME_COMMENT,
				CLM_NAME_USER_ID, CLM_NAME_GOSSIP_ID };
		
	}
	
	/**
	 * This class represents the constants and the data related to the option
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class Option implements BaseColumns{
		
		public static final String TABLE_NAME="option";
		public static final String CLM_NAME_TEXT ="toption";
		public static final String[] ALL_COLUMNS={_ID, CLM_NAME_TEXT};
		
	}
	
	/**
	 * This class represents the constants and the data related to the tag
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class Tag implements BaseColumns{
		
		public static final String TABLE_NAME="tag";
		public static final String CLM_NAME_TEXT ="ttag";
		public static final String[] ALL_COLUMNS={_ID, CLM_NAME_TEXT};
		
	}
	/**
	 * This class represents the constants and the data related to the game_option
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class GameOption implements BaseColumns{
		
		public static final String TABLE_NAME="game_option";
		public static final String CLM_NAME_GAME_ID ="game_id";
		public static final String CLM_NAME_OPTION_ID ="option_id";
		public static final String[] ALL_COLUMNS={_ID, CLM_NAME_GAME_ID,CLM_NAME_OPTION_ID};
		
	}
	
	/**
	 * This class represents the constants and the data related to the pgame_tag
	 * table in the database
	 * @author Monica Lozano
	 *
	 */
	public static abstract class PlayGameTag implements BaseColumns{
		
		public static final String TABLE_NAME="pgame_tag";
		public static final String CLM_NAME_PGAME_ID ="pgame_id";
		public static final String CLM_NAME_TAG_ID ="tag_id";
		public static final String[] ALL_COLUMNS={_ID, CLM_NAME_PGAME_ID,CLM_NAME_TAG_ID};
		
	}
	
	

}
